<ul><?php
foreach ($badges as $badge) {
  if ($badge->rank < 1) {
    continue;
  }
  echo "<li><span class=\"badge rank rank-{$badge->rank}\">●</span> {$badge->name}</li>";
}
?></ul>